package org.apache.ocean.main.name;

import java.net.URL;

import org.apache.ocean.main.util.CElement;
import org.apache.ocean.main.util.XMLUtil;
import org.jdom.Element;

public class Name implements CElement {
  private String id;
  private URL url;
  private Long highestReplicationId;
  private String masterId;
  
	public Name(String id, URL url, String masterId, Long highestReplicationId) {
		this.id = id;
		this.url = url;
		this.masterId = masterId;
		this.highestReplicationId = highestReplicationId;
	}
  
	public String getMasterId() {
		return masterId;
	}
	
	public String getId() {
		return id;
	}

	public URL getUrl() {
		return url;
	}

	public Long getHighestReplicationId() {
		return highestReplicationId;
	}

	public Name(Element element) throws Exception {
  	XMLUtil.reflectToObject(this, element);
  }
  
  public Element toElement() throws Exception {
  	return XMLUtil.reflectToElement("name", this);
  }
}
